package com.hopes.bizz.basic.common.api.feign;


import com.hopes.bizz.basic.hazard.source.entity.HazHazardSourceEntity;
import com.hopes.bizz.basic.hazard.source.entity.HazMonitorFactorEntity;
import com.hopes.bizz.common.core.constant.ServiceNameConstants;
import com.hopes.boss.admin.api.resolver.IDict;
import com.hopes.boss.common.core.constant.SecurityConstants;
import com.hopes.boss.common.core.util.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(contextId = "remoteParkBasicDictService", value = ServiceNameConstants.PARK_BASIC_SERVER)
public interface RemoteParkBasicDictService extends IDict {

    /**
     * 查询重大危险源列表
     * @param from
     * @return
     */
    @GetMapping({"/hazardSource/list"})
    R<List<HazHazardSourceEntity>> getHazHazardSourceList(@RequestHeader(SecurityConstants.FROM) String from);

    /**
     * 查询重大危险源
     * @param from
     * @return
     */
    @GetMapping({"/hazardSource/{id}"})
    R<HazHazardSourceEntity> getHazHazardSourceById(@PathVariable("id") Long id, @RequestHeader(SecurityConstants.FROM) String from);

    /**
     * 查询危险源监控因子设置列表
     * @param from
     * @return
     */
    @GetMapping({"/monitorFactor/list"})
    R<List<HazMonitorFactorEntity>> getHazMonitorFactorList(@RequestHeader(SecurityConstants.FROM) String from);

    /**
     * 查询重大危险源
     * @param from
     * @return
     */
    @GetMapping({"/monitorFactor/{id}"})
    R<HazMonitorFactorEntity> getHazMonitorFactorById(@PathVariable("id") Long id, @RequestHeader(SecurityConstants.FROM) String from);

    /**
     * 查询危险源监控因子设置 数量
     * @param from
     * @return
     */
    @PostMapping({"/monitorFactor/count"})
    R<Long> getHazMonitorFactorCount(@RequestBody HazMonitorFactorEntity monitorFactor, @RequestHeader(SecurityConstants.FROM) String from);

    /**
     * 修改危险源监控因子设置
     * @param monitorFactor
     * @param from
     * @return
     */
    @PutMapping({"/monitorFactor"})
    R<Boolean> updateHazMonitorFactorById(@RequestBody HazMonitorFactorEntity monitorFactor, @RequestHeader(SecurityConstants.FROM) String from);
}
